import Vue from "vue";
import Vuex from "vuex";
import ElementUI from "element-ui";
import App from "./App.vue";
import router from "./router";
import store from "./store/index.js";
import moment from "moment";
import "default-passive-events";

import "@/assets/common/reset.css";
import "@/assets/common/iconfont/iconfont.css";
import "@/assets/common/common.less";
import "@/assets/common/variable.less";
import instance from "./api/instance";
import { Message } from "element-ui";
import i18n from "./js/i18n";
import "element-ui/lib/theme-chalk/index.css";
  

Vue.use(ElementUI);
Vue.use(Vuex);  
Vue.prototype.$message = Message;
Vue.prototype.$request = instance;
Vue.config.productionTip = false;
Vue.prototype.moment = moment;
Vue.filter("dateFormat", function (dateStr, pattern = "YYYY-MM-DD HH:mm") {
  if (!dateStr) {
    return dateStr;
  }
  return moment(dateStr).format(pattern);
});

Vue.mixin({
  methods: {
    goBack() {
      this.$router.go(-1);
    },
  },
});

new Vue({
  router,
  store,
  i18n,
  render: (h) => h(App),
}).$mount("#app");
